package com.gxd.business.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gxd.business.bind.aop.FieldBind;
import com.gxd.business.constant.DictConstants;
import com.gxd.common.core.domain.MpBaseEntity;
import com.gxd.common.utils.GUID;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @author gxd
 * @since 2025/6/13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "t_customer", autoResultMap = true)
@ApiModel(description = "资源客户表 实体类")
public class Customer extends MpBaseEntity {

    /** id生成方式：GUID */
    public void setGUID() {
        this.id = new GUID().toString();
    }

    @ApiModelProperty(value = "主键ID")
    @TableId(type = IdType.INPUT)
    private String id;

    @ApiModelProperty(value = "客户姓名")
    @NotEmpty(message = "客户姓名不能为空")
    private String customerName;

    @ApiModelProperty(value = "联系电话")
    @NotEmpty(message = "联系电话不能为空")
    private String phone;

    @ApiModelProperty(value = "性别(0男 1女 2未知)")
    @FieldBind(key = DictConstants.SYS_USER_SEX, target = "sexMc")
    @NotNull(message = "性别不能为空")
    private Integer sex;

    @ApiModelProperty(value = "性别Mc")
    @TableField(exist = false)
    private String sexMc;

    @ApiModelProperty(value = "详细地址")
    private String address;

    @ApiModelProperty(value = "所属区域")
    private String region;

    @ApiModelProperty(value = "客户来源(1抖音、2快手、3小红书、4微信公众号、5百度广告、6朋友圈广告、7电话销售)")
    @NotNull(message = "客户来源不能为空")
    @FieldBind(key = DictConstants.CUSTOMER_SOURCE, target = "customerSourceMc")
    private Integer customerSource;

    @ApiModelProperty(value = "客户来源Mc")
    @TableField(exist = false)
    private String customerSourceMc;

    @ApiModelProperty(value = "分配状态(1已分配 2未分配 3待处理)")
    @NotNull(message = "分配状态不能为空")
    @FieldBind(key = DictConstants.ASSIGN_STATUS, target = "assignStatusMc")
    private Integer assignStatus;

    @ApiModelProperty(value = "分配状态Mc")
    @TableField(exist = false)
    private String assignStatusMc;

    @ApiModelProperty(value = "意向类别(1酒水 2纪念钞 3保养品 4电子产品 5其他)")
    @NotEmpty(message = "意向类别不能为空")
    @FieldBind(key = DictConstants.INTENTION_CATEGORY, target = "intentionCategoryMc")
    private String intentionCategory;

    @ApiModelProperty("意向类别Mc")
    @TableField(exist = false)
    private String intentionCategoryMc;

    @ApiModelProperty(value = "意向等级：1非常感兴趣（已主动联系）2感兴趣（原意进一步了解）3一般（了解中）4兴趣较低 5无意向 6待跟进")
    @FieldBind(key = DictConstants.INTENTION_LEVEL, target = "intentionLevelMc")
    private Integer intentionLevel;

    @ApiModelProperty(value = "意向等级Mc")
    @TableField(exist = false)
    private String intentionLevelMc;

    @ApiModelProperty(value = "联系方式状态：1未添加 2已添加到微信 3已添加到QQ")
    @FieldBind(key = DictConstants.CONTACT_STATUS, target = "contactStatusMc")
    private Integer contactStatus;

    @ApiModelProperty(value = "联系方式状态Mc")
    @TableField(exist = false)
    private String contactStatusMc;

    @ApiModelProperty(value = "工作账号")
    private String contactAccount;

    @ApiModelProperty(value = "是否删除（0-否 1-是）")
    private Integer deleted;

    @ApiModelProperty(value = "备注")
    private String remark;
}
